package com.yanqu.road.server.cmd;

import com.yanqu.road.player.PlayerControl;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;

import io.netty.channel.ChannelHandlerContext;

@Cmd(code = Protocol.A_PLAYER_QUIT, desc = "客户端退出游戏")
public class PlayerQuitCmd implements Command {

	@Override
	public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
		long userId = packet.getPlayerId();
		PlayerControl.delayRemovePlayerOnline(userId, ctx.channel());
	}
}
